﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;

namespace ExcelDNAForWPSDemo
{
    [ComVisible(true)]
    public partial class UscProduct : UserControl
    {
        public UscProduct()
        {
            InitializeComponent();
            this.pictureBoxProduct.Image = GetPicture(picIndex);
        }

        private int picIndex = 0;
        private void btnPrevious_Click(object sender, EventArgs e)
        {
            if (picIndex == 0)
            {
                picIndex = 3;
            }
            else
            {
                picIndex--;
            }
            var img = GetPicture(picIndex);
            this.pictureBoxProduct.Image = img;
        }

        private Image GetPicture(int picIndex)
        {
            switch (picIndex)
            {
                case 0:
                    return Properties.Resources.excel催化剂;
                case 1:
                    return Properties.Resources.easyshu;
                case 2:
                    return Properties.Resources.wps演示催化剂;
                case 3:
                    return Properties.Resources.pbi催化剂;
                default:
                    return null;
            }
        }

        private void btnNext_Click(object sender, EventArgs e)
        {
            if (picIndex == 3)
            {
                picIndex = 0;
            }
            else
            {
                picIndex++;
            }

            this.pictureBoxProduct.Image = GetPicture(picIndex);
        }

        private void btnMore_Click(object sender, EventArgs e)
        {
            switch (picIndex)
            {
                case 0:
                    Process.Start("https://www.yuque.com/excelcuihuajihome/helpdocument/nsm7cr");
                    break;
                case 1:
                    Process.Start("https://www.yuque.com/easyshu/helpdocument/lyq0go");
                    break;
                case 2:
                    Process.Start("https://www.yuque.com/wpsjs/articles/gb189a");
                    break;
                case 3:
                    Process.Start("https://www.yuque.com/excelcuihuajihome/helpdocument/cmqa50");
                    break;
                default:
                    break;
            }
        }
    }
}
